<?php


    // Author: Tomasz Durka
    // Creation date: 15th August 2009
    // Prints out Javascript code updating $('notice')
    
    
  function js_set_notice($value, $prefix = '') {
    
    //$value = htmlspecialchars($value);
    $value = str_replace ('"', '&quot;', $value);
    $code .= "{$prefix}$('notice').update(\"{$value}\");";
    $code .= "{$prefix}$('notice').show();";
    $code .= "{$prefix}$('notice').style.marginLeft= -{$prefix}$('notice').getWidth()/2 + 'px';";
    
    return js_query ($code);
  }

?>